﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Web;

namespace KgUtils.Web
{
    public static partial class HttpRequestExtension
    {
        public static int? GetIntFromRequest(this HttpRequest request, string elementName)
        {
            string requestId = request[elementName];
            int id;
            if (int.TryParse(requestId, out id))
                return id;
            else
                return null;
        }

        public static string GetStringFromRequest(this HttpRequest request, string elementName)
        {
            string value = request[elementName];

            return value;
        }
    }
}
